package com.example.transation.txlconsumer.controller;

import com.example.transation.txlcncommon.bean.Result;
import com.example.transation.txlconsumer.server.ConsumerService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;


/**
 * 消费服务Controller
 *
 * @author luojm
 * 2020-08-31 11:05:10
 */

@RestController
@AllArgsConstructor
@RequestMapping(value = "/consumer")
public class ConsumerController{

  private final ConsumerService consumerService;

  @GetMapping("/hello" )
  public Result hello() {
    return Result.success("hello 成功了！");
  }

  @GetMapping("/provider" )
  public Result provider() {
      return consumerService.provider();
  }

  @GetMapping("/txlcn/test/{s}" )
  public Result txlcnTest(@PathVariable("s") String s) throws IOException {
    return consumerService.txlcnTest(s);
  }
}
